﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinFormsApp1.Common;

namespace WinFormsApp1.Leo.week02
{
    public partial class ScaleTypetes : Form
    {
        public ScaleTypetes()
        {
            InitializeComponent();
        }

        public record ScaleTypese(string ScaleTypeName);

        private async void button1_Click(object sender, EventArgs e)
        {
            var scaleTypeName = textBox1.Text;
            ScaleTypese scaleTypese = new(scaleTypeName);
            var res = await HttpClientHelper.RequestUrl<ScaleTypese, ApiResult<ScaleTypese>>(URLCommon.Url1, "/WorkList01_leo/GetScaleAdd", HttpClientHelper.MethodType.POST, scaleTypese);
            if (res.Code == 1)
            {
                MessageBox.Show("添加成功");
            }
        }
    }
}
